$(document).ready(function(){
    
    $('#loginbtn').click(function(e){
        e.preventDefault();
        var account = $('#account').val();
        var pwd = $('#pwd').val();

        if(account == ''){
            mui.toast('请输入用户名');
            return;
        }
        if(pwd == ''){
            mui.toast('请输入密码');
            return;
        }
        var params = {account:account,pwd,pwd};
        $.ajax({
            url:pub_diss_login,
            type:"post",
            data:params,
            contentType:"application/x-www-form-urlencoded",
            success:function(data){
                var res = JSON.parse(data);
                if(res.code == '20000'){
                    location.href = '../../func/distributor/index.html'
                }else{
                    mui.toast(data.msg);
                }
            },
            error:function(err){
                mui.toast('登陆错误');
            }

        })


    })




})